import time
import app
from tool.HTMLTestRunner import HTMLTestRunner
import unittest

suite = unittest.defaultTestLoader.discover(start_dir='./scripts/', pattern='test*.py')
report_dir = app.dir_url + '/report/report{}.html'.format(time.strftime('%Y%m%d-%H%M%S'))
with open(report_dir, 'wb') as f:
    HTMLTestRunner(stream=f, title='IHRM测试报告').run(suite)
